package main

import (
	"fmt"
	"time"
)

var tz, _ = time.LoadLocation("Asia/Shanghai")

func afterday(y int) *time.Time {
	tz, _ := time.LoadLocation("Asia/Shanghai")
	str_t1 := time.Now().Local().Format("-01-02 15:04:05")
	str_t2 := fmt.Sprint(time.Now().Year()-8, str_t1)
	fmt.Println(str_t2)
	time_t2, err := time.ParseInLocation("2006-01-02 15:04:05", str_t2, tz)
	if err != nil {
		panic(err)
	}
	fmt.Println(time_t2)
	return &time_t2
}

func homework1() {

	t2 := afterday(8)
	fmt.Printf("%d\n", t2.UnixMilli())                         //毫秒
	fmt.Printf("%v\n", t2.Format("2006-01-02 15:04:05 -0700")) //格式化输出

	fmt.Println(t2.Weekday())     //那天是星期几
	fmt.Println(t2.YearDay() / 7) //过了好几周

}
